package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.cnswhy.cloud.server.common.entity.enumeration.ChannelType;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-07-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_cps_bank_rate_split")
@ApiModel(value = "CpsBankRateSplit", description = "")
@AllArgsConstructor
public class CpsBankRateSplit extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 银行简称
     */
    @ApiModelProperty(value = "银行简称")
    @Length(max = 20, message = "银行简称长度不能超过20")
    @TableField(value = "bank_abbr", condition = LIKE)
    @Excel(name = "银行简称")
    private String bankAbbr;

    /**
     * 银行名称
     */
    @ApiModelProperty(value = "银行名称")
    @Length(max = 255, message = "银行名称长度不能超过255")
    @TableField(value = "bank_name", condition = LIKE)
    @Excel(name = "银行名称")
    private String bankName;

    /**
     * 费率
     */
    @ApiModelProperty(value = "费率")
    @TableField("fee_rate")
    @Excel(name = "费率")
    private Integer feeRate;

    /**
     * 附加手续费
     */
    @ApiModelProperty(value = "附加手续费")
    @TableField("extern_fee")
    @Excel(name = "附加手续费")
    private Integer externFee;

    /**
     * 渠道编号
     */
    @ApiModelProperty(value = "渠道编号")
    @Length(max = 10, message = "渠道编号长度不能超过10")
    @TableField(value = "channel_id", condition = LIKE)
    @Excel(name = "渠道编号")
    private String channelId;

    /**
     * 钱包类型 #ChannelType{LITTLE:小额;LARGE:大额;}
     */
    @ApiModelProperty(value = "钱包类型 #ChannelType{LITTLE:小额;LARGE:大额;}")
    @TableField("channel_type")
    @Excel(name = "钱包类型 #ChannelType{LITTLE:小额;LARGE:大额;}", replace = {"小额_LITTLE", "大额_LARGE",  "_null"})
    private ChannelType channelType;


    @Builder
    public CpsBankRateSplit(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    String bankAbbr, String bankName, Integer feeRate, Integer externFee, String channelId, ChannelType channelType) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.bankAbbr = bankAbbr;
        this.bankName = bankName;
        this.feeRate = feeRate;
        this.externFee = externFee;
        this.channelId = channelId;
        this.channelType = channelType;
    }

}
